package org.example.auth.repository;

import org.example.auth.model.entity.RoleAuthority;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.Collection;
import java.util.List;
import java.util.Optional;

public interface RoleAuthorityRepository extends JpaRepository<RoleAuthority, Long> {


    List<RoleAuthority> findByRoleIdIn(List<Long> roleId);

    List<RoleAuthority> findByRoleId(Long roleId);

    List<RoleAuthority> findByAuthorityId(Long authorityId);

    List<RoleAuthority> findByRoleIdAndAuthorityIdIn(Long roleId, Collection<Long> authorityId);

    Optional<RoleAuthority> findByRoleIdAndAuthorityId(Long roleId, Long authorityId);
}
